<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<button onclick="fun1()">添加文本</button>
		<button onclick="fun2()">添加图片</button>
		<div id="con"></div>
		
		<script type="text/javascript">
			var fun1 = function(){
				var t = document.createElement("div");
				t.innerHTML="文字";
				t.setAttribute("style","color: red;")
				document.getElementById("con").appendChild(t);
			}
			var fun2 = function(){
				var i = document.createElement("img");
				i.setAttribute("src","img/off.png");
				i.setAttribute("width","100px");
				document.getElementById("con").appendChild(i);
			}
		</script>
	</body>
</html>
